1 /*
2 * Angkor Web Framework
3 *
4 * Distributable under LGPL license.
5 * See terms of license at gnu.org.
6 */
7
8 package com.tirsen.angkor;
9
10 import java.io.IOException;
11
12 /***
13 * This is the interface the engine has to the widgets.
14 *
15 * <p>
16 *
17 * The responsibilities a view has is:
18 * <li> to render itself based on data from a Model and other attributes.
19 * <li> parse the request.
20 * <li> update the Model according to the parsed request.
21 * <li> post events to Controllers according to the parsed request.
22 *
23 * <p>
24 *
25 * When we implement pluggable look-and-feel the rendering can be overrided
26 * by a look-and-feel. In that case the view needs to document how it parses
27 * a request well. This implies that the look-and-feel has a white-box view of the
28 * view.
29 *
30 * @author $Author: tirsen $
31 * @version $Revision: 1.4 $
32 * <BR>
33 * $Id: View.java,v 1.4 2002/10/09 21:37:37 tirsen Exp $
34 */
35 public interface View
36 {
37 View getContainer();
38
39 void setContainer(View container);
40
41 /***
42 * The unique id is unique over an application instance.
43 * Ie. unique over user/session and application instance.
44 */
45 String uniqueId(RenderContext context);
46
47 /***
48 * Render this view on the given context if the view is visible.
49 * Performed during render-phase.
50 * @see #setVisible
51 * @see #isVisible
52 */
53 void render(RenderContext context) throws IOException;
54
55 /***
56 * When a view has registered during rendering for parsing in the RenderContext
57 * the context will call this method on the <em>next</em> request.
58 * The view is responsible for parsing the request based on it's unique id and
59 * update models and sending events based on the request. In most cases the
60 * EventQueue should be used to send the events. This ensures that the models
61 * are all correctly updated before the events are actually processed. This is important
62 * since controllers (whom processes the events) must rely on this to process events correctly.
63 */
64 void parse(RenderContext context);
65
66 /***
67 * Specify whether this view is visible or not.
68 */
69 void setVisible(boolean visible);
70
71 /***
72 * Check whether this view is visible or not.
73 */
74 boolean isVisible();
75 }
This page was automatically generated by Maven